package uy.com.tsi2G7.superbet.ui;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;

public class BetHistoryDescriptor implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String eventName;
	private String eventTypeName;
	private String marketName;
	private String marketResultName;
	private BigDecimal amount;
	private Date date;
	private BigDecimal result;
	private Long compositeId;
	private String user;
	private long resultId;
	private long eventId;
	private long marketId;
	private long eventTypeId;
	
	
	
	public BetHistoryDescriptor() {
		super();
	}	
	
	public BetHistoryDescriptor(String eventName, String eventTypeName,
			String marketName, String marketResultName, BigDecimal amount,
			Date date, BigDecimal result) {
		super();
		this.eventName = eventName;
		this.eventTypeName = eventTypeName;
		this.marketName = marketName;
		this.marketResultName = marketResultName;
		this.amount = amount;
		this.date = date;
		this.result=result;
	}
	
	public BetHistoryDescriptor(String eventName, String eventTypeName,
			String marketName, String marketResultName, BigDecimal amount,
			Date date, BigDecimal result, String user,long resultId, long eventId, long marketId, long eventTypeId) {
		super();
		this.eventName = eventName;
		this.eventTypeName = eventTypeName;
		this.marketName = marketName;
		this.marketResultName = marketResultName;
		this.amount = amount;
		this.date = date;
		this.result=result;
		this.user = user;
		this.resultId = resultId;
		this.eventId = eventId;
		this.marketId = marketId;
		this.eventTypeId = eventTypeId;
	}
	
	public String getEventName() {
		return eventName;
	}
	public void setEventName(String eventName) {
		this.eventName = eventName;
	}
	public String getEventTypeName() {
		return eventTypeName;
	}
	public void setEventTypeName(String eventTypeName) {
		this.eventTypeName = eventTypeName;
	}
	public String getMarketName() {
		return marketName;
	}
	public void setMarketName(String marketName) {
		this.marketName = marketName;
	}
	public String getMarketResultName() {
		return marketResultName;
	}
	public void setMarketResultName(String marketResultName) {
		this.marketResultName = marketResultName;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	
	public String getAmountFormatted(){
		return amount==null?"$ 0":new DecimalFormat("$ ###.##").format(amount.doubleValue());
	}
	
	public String getDateFormatted(){
		return new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(date);
	}
	public BigDecimal getResult() {
		return result;
	}
	public void setResult(BigDecimal result) {
		this.result = result;
	}
	public String getResultFormatted(){
		if (result != null){
			return result.doubleValue()<0?"-":new DecimalFormat("$ ###.##").format(result.doubleValue());
		}else{
			return "0";
		}
	}

	public Long getCompositeId() {
		return compositeId;
	}

	public void setCompositeId(Long compositeId) {
		this.compositeId = compositeId;
	}


	public String getUser() {
		return user;
	}


	public void setUser(String user) {
		this.user = user;
	}

	public long getResultId() {
		return resultId;
	}

	public void setResultId(long resultId) {
		this.resultId = resultId;
	}

	public long getEventId() {
		return eventId;
	}

	public void setEventId(long eventId) {
		this.eventId = eventId;
	}

	public long getMarketId() {
		return marketId;
	}

	public void setMarketId(long marketId) {
		this.marketId = marketId;
	}

	public long getEventTypeId() {
		return eventTypeId;
	}

	public void setEventTypeId(long eventTypeId) {
		this.eventTypeId = eventTypeId;
	}

}
